import request, { get, post } from '@/utils/request'

// 获取风控提醒
export function getRiskAlerts() {
  return get('/risk/alerts', {}, {
    showLoading: false,
    showError: true
  })
}

// 标记风控提醒已读
export function markAlertAsRead(alertId) {
  return post(`/risk/alerts/${alertId}/read`, {}, {
    showLoading: false,
    showError: true
  })
}

// 获取风控统计数据
export function getRiskStatistics() {
  return get('/risk/statistics', {}, {
    showLoading: false,
    showError: true
  })
}

// 批量标记提醒已读
export function markMultipleAlertsAsRead(alertIds) {
  return post('/risk/alerts/batch-read', { alertIds }, {
    showLoading: true,
    loadingText: '标记中...'
  })
}

// 获取风控配置
export function getRiskConfig() {
  return get('/risk/config', {}, {
    showLoading: false
  })
}

// 更新风控配置
export function updateRiskConfig(config) {
  return post('/risk/config', config, {
    showLoading: true,
    loadingText: '保存中...'
  })
}
